package com.cxb.apipassenger.controller;

import com.cxb.apipassenger.service.OrderService;
import com.cxb.internalcommon.dto.ResponseResult;
import com.cxb.internalcommon.request.OrderRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {

    @Autowired
    private OrderService orderService;
    //拦截器打开权限
    /**
     * 创建订单/乘客下单
     * @param orderRequest
     * @return
     */
    @PostMapping("/add")
    public ResponseResult add(@RequestBody OrderRequest orderRequest){
        log.info("api-passenger:"+orderRequest.getAddress());
        return orderService.add(orderRequest);
    }
}
